import * as path from "path";

export function isJPG(file: string) {
	const ext = path.extname(file);
	return ext.toLowerCase() === ".jpg";
}

export function isXML(file: string) {
	const ext = path.extname(file);
	return ext.toLowerCase() === ".xml";
}

export function resolvePath(file: string) {
	return path.resolve(process.cwd(), file);
}

export function resolvePureName(file: string) {
	const base = path.basename(file);
	const index = base.lastIndexOf(".");
	return base.slice(0, index);
}
